package com.insurance.mapper;

import com.insurance.pojo.Information;
import com.insurance.pojo.UserPermissions;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * Created with IntelliJ IDEA.
 * User: 朱雄
 * Date: 2020/10/29 21:19
 * Description:
 * Version: V1.0
 */
public interface AuthorityMapper {
    int addInform(Information information);

    /**
     * 查询所有可用司机id
     * @return
     */
    int[] queryDriver();

    /**
     * 给司机添加消息
     * @param infoId
     * @param driverId
     * @return
     */
    int addInformDriver(@Param("infoId") int infoId,@Param("driverId") int[] driverId);

    /**
     * 查询所有可用用户id
     * @return
     */
    int[] queryUserId();

    /**
     * 给用户添加消息
     * @param infoId
     * @param userId
     * @return
     */
    int addInformUser(@Param("infoId") int infoId,@Param("userId") int[] userId);

    /**
     * 查询所有消息
     * @return
     */
    List<Map> queryInform();

    int delInform(Information information);

    List<Map> queryAuthorityList();

    /**
     *
     * @param user_id
     * @return
     */
    int[] querypermissions(@Param("user_id") Object user_id);

    /**
     * 添加用户
     * @param userPermission
     * @return
     */
    int addAuthority(UserPermissions userPermission);

    /**
     * 添加用户权限
     * @param user_id
     * @param permissions
     * @return
     */
    int addUserPermission(@Param("user_id") int user_id,@Param("permissions") int[] permissions);

    /**
     * 修改用户基本信息
     * @param userPermission
     * @return
     */
    int updateAuthority(UserPermissions userPermission);

    /**
     * 删除用户权限
     * @param user_id
     * @return
     */
    int delPermissionUser(int user_id);

    /**
     *
     * @param userId
     * @param userStatu
     * @return
     */
    int editAuthorityStatu(@Param("userId") Integer userId,@Param("userStatu") Integer userStatu);

    /**
     *
     * @param userId
     * @return
     */
    int deleteAuthority(@Param("userId") Integer userId);

    /**
     * 查询已开通市以及省信息
     * @return
     * @param province_id
     */
    List<Map> queryCityAll(Object province_id);

    List<Map> queryPerAll();

    List<Map> queryAreaAll(Object city_id);

    List<Map> queryCityAllCount();

    List<Map> queryByCityStrtu(int province_id);

    int addCity(int cityId);
    int deleteCity(int cityId);
}
